import request from '@/utils/request'
/**
 * 获取组织架构数据
 */
/**
 * 获取部门列表
 * @returns 
 */
export function getDepartments() {
    return request({
        url: '/company/department'
    })
}
/**
 * 删除部门详情
 * @param {*} id 
 * @returns 
 */
export function delDepartments(id) {
    return request({
        method: 'DELETE',
        url:`/company/department/${id}`
    })
}
/**
 * 新增
 * @param {*} data 
 * @returns 
 */
export function addDepartments(data) {
    return request({
        url: '/company/department',
        method: 'POST',
        data
    })
}
/**
 * 获取部门详情
 * @param {*} id 
 * @returns 
 */
export function getDepartDetail(id) {
    return request({
        url: `/company/department/${id}`
    })
}
/**
 * 修改部门信息
 * @param {*} data 
 * @returns 
 */
export function updateDepartments(data) {
    return request({
        url: `/company/department/${data.id}`,
        method: 'PUT',
        data
        
    })
}

